using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;

namespace ILRuntime.Runtime.Generated
{
    unsafe class mb_Http_Binding_Option_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(mb.Http.Option);

            field = type.GetField("Url", flag);
            app.RegisterCLRFieldGetter(field, get_Url_0);
            app.RegisterCLRFieldSetter(field, set_Url_0);
            field = type.GetField("Method", flag);
            app.RegisterCLRFieldGetter(field, get_Method_1);
            app.RegisterCLRFieldSetter(field, set_Method_1);
            field = type.GetField("Body", flag);
            app.RegisterCLRFieldGetter(field, get_Body_2);
            app.RegisterCLRFieldSetter(field, set_Body_2);
            field = type.GetField("OnFinish", flag);
            app.RegisterCLRFieldGetter(field, get_OnFinish_3);
            app.RegisterCLRFieldSetter(field, set_OnFinish_3);
            field = type.GetField("OnProgress", flag);
            app.RegisterCLRFieldGetter(field, get_OnProgress_4);
            app.RegisterCLRFieldSetter(field, set_OnProgress_4);
            field = type.GetField("ContentType", flag);
            app.RegisterCLRFieldGetter(field, get_ContentType_5);
            app.RegisterCLRFieldSetter(field, set_ContentType_5);
            field = type.GetField("TimeoutSec", flag);
            app.RegisterCLRFieldGetter(field, get_TimeoutSec_6);
            app.RegisterCLRFieldSetter(field, set_TimeoutSec_6);
            field = type.GetField("Response", flag);
            app.RegisterCLRFieldGetter(field, get_Response_7);
            app.RegisterCLRFieldSetter(field, set_Response_7);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_Url_0(ref object o)
        {
            return ((mb.Http.Option)o).Url;
        }
        static void set_Url_0(ref object o, object v)
        {
            ((mb.Http.Option)o).Url = (System.String)v;
        }
        static object get_Method_1(ref object o)
        {
            return ((mb.Http.Option)o).Method;
        }
        static void set_Method_1(ref object o, object v)
        {
            ((mb.Http.Option)o).Method = (System.Net.Http.HttpMethod)v;
        }
        static object get_Body_2(ref object o)
        {
            return ((mb.Http.Option)o).Body;
        }
        static void set_Body_2(ref object o, object v)
        {
            ((mb.Http.Option)o).Body = (System.String)v;
        }
        static object get_OnFinish_3(ref object o)
        {
            return ((mb.Http.Option)o).OnFinish;
        }
        static void set_OnFinish_3(ref object o, object v)
        {
            ((mb.Http.Option)o).OnFinish = (System.Action<System.Boolean, System.Int32, System.String>)v;
        }
        static object get_OnProgress_4(ref object o)
        {
            return ((mb.Http.Option)o).OnProgress;
        }
        static void set_OnProgress_4(ref object o, object v)
        {
            ((mb.Http.Option)o).OnProgress = (System.Action<System.Int64, System.Int64>)v;
        }
        static object get_ContentType_5(ref object o)
        {
            return ((mb.Http.Option)o).ContentType;
        }
        static void set_ContentType_5(ref object o, object v)
        {
            ((mb.Http.Option)o).ContentType = (System.String)v;
        }
        static object get_TimeoutSec_6(ref object o)
        {
            return ((mb.Http.Option)o).TimeoutSec;
        }
        static void set_TimeoutSec_6(ref object o, object v)
        {
            ((mb.Http.Option)o).TimeoutSec = (System.Int32)v;
        }
        static object get_Response_7(ref object o)
        {
            return ((mb.Http.Option)o).Response;
        }
        static void set_Response_7(ref object o, object v)
        {
            ((mb.Http.Option)o).Response = (System.Net.Http.HttpResponseMessage)v;
        }

        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new mb.Http.Option();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
